package com.kaifamiao.www.demo.Do25.pm;

public class Test01 {

    public static void main(String[] args) {
        Person me = new Person();
        me.name ="蔡徐坤";
        me.gender = me.getGender();
        me.age = me.getAge();
        me.isMarry=false;

        Person obj = new Person();
        // 对象的属性
        obj.name = "小黑子";
        obj.gender = obj.getGender();
        obj.age = obj.getAge();
        obj.isMarry = false;
        System.out.println("蔡徐坤的性别: "+me.gender+" 蔡徐坤的年龄:"+me.age);
        System.out.println("小黑子的性别: "+obj.gender+" 小黑子的年龄:"+obj.age);

        if(me.canMarry(obj)){
            System.out.println(me.name+"能和"+obj.name+"结婚");
        }else{
            System.out.println(me.name+"不能和"+obj.name+"结婚");
        }

    }
}
